import java.text.SimpleDateFormat;
import java.util.Calendar;

public class MonthTest {
        public static void main(String[] args) {
            int year = 2020;
            Calendar cal = Calendar.getInstance();
            cal.set(Calendar.YEAR, year);
            System.out.printf("%s年的学士后月考时间是:",year);
            System.out.println();
            for(int k=0;k<12;k++){
            cal.set(Calendar.MONTH, k);
            int maxDate = cal.getActualMaximum(Calendar.DATE);
            int sundays = 0;
            for(int i = 1; i <= maxDate; i ++) {
                cal.set(Calendar.DATE, i);
                if(cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY) {
                    sundays ++;
                    if(sundays == 1) {
                        break;
                    }
                }
            }
            String date = new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime());
                System.out.print(date);
                System.out.println();
                }
        }
    }
